package com.base.system.managedBean;

import java.io.Serializable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.operamasks.faces.annotation.Action;
import org.operamasks.faces.annotation.ManagedBean;
import org.operamasks.faces.annotation.ManagedBeanScope;
import org.operamasks.faces.user.util.Browser;

import com.base.organization.entity.Position;
import com.base.system.managedBean.baseBean.BasePositionBean;

@ManagedBean(name = "system_addPositionBean", scope = ManagedBeanScope.REQUEST)
public class AddPositionBean extends BasePositionBean implements Serializable {
	private final static Log logger = LogFactory.getLog(AddPositionBean.class);

	@Action(id = "save")
	public void save() {
		if (post == null)
			post = new Position();
		this.setPostProperty();
		postDao.saveOrUpdate(post);
		String script = "closeCenterLayoutTab('addPositionTab')";
		Browser.execClientScript("window.top", script);
	}

}
